home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / byteibm.arc / DAHMKE.ARC / MCDFIG5.ASM next >
Encoding:
Assembly Source File  |  1985-07-12  |  1.0 KB  |  32 lines

  1. ;---------------------------------------------------------------
  2. ;  SETFRAME:  Sets the environment upon entry to a subroutine.
  3. ;
  4. SETFRAME MACRO
  5.     PUSH    BP        ;SAVE FRAMEPOINTER ON STACK
  6.     MOV    BP,SP
  7.       ENDM
  8. ;
  9. ;  POPRET:    Restores the BP register and returns to the
  10. ;             calling FORTRAN routine after cleaning up the
  11. ;             stack.
  12. ;
  13. POPRET  MACRO   NPARMS        ;RETURN FROM SUBR.  NPARMS=NUMBER OF PARMS
  14.     POP    BP
  15.     RET    NPARMS*4
  16.     ENDM
  17. ;
  18. ; GETPARM: returns a pointer to a parameter in the call list.
  19. ;       Operands:  X = the number of the desired parameter
  20. ;                MAX = the maximum number of parameters in
  21. ;                      the call list.
  22. ;
  23. ;       Result: The ES:BX register pair points to the parameter.
  24. ;
  25. GETPARM    MACRO     X,MAX         ;PARAMETER NUMBER (IE, 1,2,3)
  26.     LES    BX,DWORD PTR SS:[BP+(MAX-X)*4+6] 
  27.     ENDM
  28. ;
  29. ;
  30. ;--------------------------------------------------------------
  31.